package com.yhcrt.utils;

import java.util.*;
import java.util.stream.Collectors;

/**
 *
 * @Description: 系统常量参数
 * @author: 陈伟
 * @date: 2017年5月14日 下午5:06:13
 * @version: V1.0
 */
public abstract class Constants {
    /**************************************初始化数据*****************************************/

	/***项目根路径*/
    public static final String CONTEXT_PATH = "basePath";
    /**当前年份**/
    public static final int NOW_YEAY = Calendar.getInstance().get(Calendar.YEAR);
	/**当前月份**/
    public static final int NOW_MONTH = Calendar.getInstance().get(Calendar.MONTH);
	/**默认状态吗(0)**/
    public static final Integer Middle = 0;
    /**状态码(1)**/
    public static final Integer Middle_1 = 1;
    /**状态码(2)**/
    public static final Integer Middle_2 = 2;
    /**状态码(3)**/
    public static final Integer Middle_3 = 3;
	/**状态吗(-1)**/
    public static final Integer Middle_01 = -1;

    /**赛事id**/
    public static final Integer matchId = 3;
    public static final Integer QSN_ID = 12;
    public static final Integer QZTY_ID = 13;
    public static final Integer SHJLB_ID = 18;

    /**************************************数据库表标识*****************************************/

    /**系统部门信息表标识(sys_dept)**/
    public static final String SYS_DEPT = "sys_dept";
    /**数据字典配置表标识(sys_list_data)**/
    public static final String SYS_LIST_DAYTA = "sys_list_data";
    /**系统权限资源表标识(sys_res)**/
    public static final String SYS_RES = "sys_res";
    /**系统角色表标识(sys_role)**/
    public static final String SYS_ROLE = "sys_role";
    /**系统账号信息表标识(sys_user)**/
    public static final String SYS_USER = "sys_user";
    /**系统操作日志信息表标识(sys_operation_log)**/
    public static final String SYS_SYSTEM_LOG= "sys_system_log";


    /**附件配置信息表标识(sys_file_config)**/
    public static final String SYS_FILE_CONFIG= "sys_file_config";
    /**附件信息表标识(yw_file)**/
    public static final String YE_FILE= "yw_file";

    /**参赛单位信息表标识(unit_info)**/
    public static final String UNIT_INFO = "unit_info";
    /**参赛运动员信息表标识(athlete_base_info)**/
    public static final String ATHLETE_BASE_INFO = "v2_athlete_info";
    /**界别信息表标识(circles)**/
    public static final String CIRCLES = "circles";
    /**竞赛项目记录库表标识(com_record)**/
    public static final String COM_RECORD = "com_record";

    /**奖惩信息表标识(pub_rew_info)**/
    public static final String PUB_REW_INFO = "pub_rew_info";
    /**计分计牌表标识(score_record)**/
    public static final String SCORE_RECORD = "score_record";

    /**************************************ajax返回状态*****************************************/

    /**没有数据(nodata)**/
    public static final String NO_DATA = "nodata";
    /**成功(success)**/
    public static final String SUCCESS = "success";
    /**异常(failed)**/
    public static final String FAILED = "failed";
    /**密码不正确(errorPwd)**/
    public static final String ERROR_PWD = "errorPwd";
    /**两次密码不一致(errortwo)**/
    public static final String ERROR_TWO = "errortwo";

    //进首页时加载项目数据  add by Rocye in 2024.06.11
    public static Map<String, String> PROJ_CODE2NAME_MAP = null;
    //根据编码得到名称
    public static String getNameByCode(String classCode, int startInx) {
        int len = classCode.length() / 4;
        List<String> codeList = new ArrayList<>();
        for(int i = 1; i <= len; i++) {
            codeList.add(classCode.substring(0, i*4));
        }
        List<String> nameList = new ArrayList<>();
        for(int i = startInx; i < len; i++) {
            nameList.add(PROJ_CODE2NAME_MAP.get(codeList.get(i)));
        }
        return String.join("|", nameList);
    }

}
